﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkyFab.Master" AutoEventWireup="true" CodeBehind="EditVendorPOItems.aspx.cs" Inherits="Web.EditVendorPOItems" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:Label ID="FlashMessageLabel" runat="server"></asp:Label>
    <table style="width:100%;">
        <tr>
            <td colspan="3">
                <h1>&nbsp;Vendor Orders list<asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                </h1></td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:GridView ID="OrderListGridView" runat="server" AutoGenerateColumns="False" 
                    CellPadding="4" GridLines="None" DataKeyNames="Id" CssClass="gridview" 
                    Width="100%">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HiddenField ID="ProductIdHiddenField" runat="server" Value='<%#Eval("ProductId") %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:BoundField DataField="ProductNo" HeaderText="No" />
                        <asp:BoundField DataField="ProductName" HeaderText="Name" />
                        <asp:TemplateField HeaderText="Quantity">
                            <ItemTemplate>
                                <asp:TextBox ID="QuantityTextBox" runat="server" Height="20px" Width="38px" Text='<%# Eval("RequestQty") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="QuantityTextBox" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ControlToValidate="QuantityTextBox" ErrorMessage="*" ForeColor="Red" 
                                    ValidationExpression="^[1-9]\d*$"></asp:RegularExpressionValidator>
                            </ItemTemplate>
                            
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Net Price">
                            <ItemTemplate>
                                <asp:TextBox ID="NetPriceTextBox" runat="server" Height="20px" Width="38px" Text='<%# Eval("Price") %>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="NetPriceTextBox" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                    ControlToValidate="NetPriceTextBox" ErrorMessage="*" ForeColor="Red" 
                                    ValidationExpression="^[0-9]+(.[0-9]{1,3})?$"></asp:RegularExpressionValidator>
                            </ItemTemplate>
                            
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Select All">
                            <ItemTemplate>
                                <asp:CheckBox ID="SelectOrderCheckBox" runat="server" Checked="true"/>
                            </ItemTemplate>
                            <HeaderTemplate>
                       <asp:CheckBox ID="cbSelectAll" runat="server" AutoPostBack="true" oncheckedchanged="cbSelectAll_CheckedChanged" 
                                                       Checked="true" Text="Select all"  />
                    </HeaderTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HiddenField ID="OrderIdHiddenField" runat="server" Value='<%#Eval("Id") %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete" 
                                    Enabled="False">Delete</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    
                    <AlternatingRowStyle BackColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle HorizontalAlign="Center" CssClass="pagerTable" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="MakeVendorPOButton" runat="server" 
                    onclick="MakeVendorPOButton_Click" Text="Make Vendor PO" />
                <asp:Label ID="AlertLabel" runat="server" ForeColor="Red"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
